#ifndef TELEMETRYPLOT_H
#define TELEMETRYPLOT_H

#include <QObject>

#include "mainwindow.h"
#include "ui_mainwindow.h"

#include "qwt.h"
#include "qwt_plot.h"
#include "qwt_plot_curve.h"
#include "qwt_plot_grid.h"
#include "qwt_symbol.h"
#include "qwt_plot_magnifier.h"

class TelemetryPlot : public QObject
{
    Q_OBJECT
public:
    explicit TelemetryPlot(Ui::MainWindow* ui, QObject *parent = 0);

signals:

public slots:
    void plotTelemetry(QList<float> values);

private:
    Ui::MainWindow* ui;
    QwtPlot *my2DPlot;
    QList<QPolygonF*> *telemetry;
    QwtPlotMagnifier *magnifier;
    QList<QwtPlotCurve*> *curves;
    QwtPlotGrid *grid;

    QStringList colorNames;

    double viewIntervalSize;
    double viewIntervalStart;
    double time;
    bool firstrun;

    void setComboBoxColors(QComboBox *box);


private slots:
    void moveXaxis(int value);
    void clear();
    void savePlots();
};

#endif // TELEMETRYPLOT_H
